<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<html>
	<head>
		<title>生成验证码</title>
<%@ include file="/comm.jsp"%>
		<script>
		$(document).ready(function() {
			$("form *").autohelp("#autohelp");
		});
		  $(document).ready(function(){
		    $('#ok').click(function() { 
		    $('#validate_build').submit(); 
		    }) 
		    $("#validate_build").validate(
		    );
		  });

		</script>

		<script language="javascript">
			function check(obj){				
				if($d("seq_iscus").checked){
					$d("seq_perfix").disabled=false;			
				}
				if($d("seq_sys").checked){
					$d("seq_perfix").disabled=true;				
					$d("seq_perfix").value="";
				}
				
				if($d("pwd_sys").checked){
					$d("pwd_perfix").disabled=true;
					$d("pwd_isnum").disabled=false;
					$d("pwd_isnum").value="pwdnum";
					$d("pwd_perfix").value="";
				}
				
				if($d("pwd_iscus").checked){
					$d("pwd_perfix").disabled=false;
					$d("pwd_isnum").disabled=true;
				    $d("pwd_isnum").checked = false;
				    $d("pwd_isnum").value="";	
				}
				
				if($d("pwd_isnum").checked){			
					$d("pwd_isnum").value="pwdnum";					
				}
				
				if($d("pwd_isvail").checked){
					$d("pwd_isvail").value="pwdisvail";					 	
				}
				
				if($d("db").checked){
					$d("buildtype").value="db";
				}
				
				if($d("file").checked){
					$d("buildtype").value="file";
				}
		
			}
			
			function initVali(){
				$d("seq_sys").checked="checked";
				$d("pwd_sys").checked="checked";
				$d("seq_perfix").disabled="disabled";
				$d("pwd_perfix").disabled="disabled";
				$d("buildtype").value="db";
			}
			
			function showOrederInfo(){				
				var arrretu  = new Array();
				var winFeatures="dialogHeight:400px;dialogWidth:660px;edge:Raised;center:Yes;help:No;resizable:No;status:No;";
				var url = "validate_getAllOrderInfo";
				arrretu = window.showModalDialog(url,"", winFeatures);
				if(arrretu ==null || (!arrretu)){
					return false;
				}else{	
					$d("seqId").value = arrretu[1].toString();
					$d("oraderId").value=arrretu[0].toString();
					$d("hseqId").value=arrretu[1].toString();
					$d("companyId").value=arrretu[2].toString();
					$d("orderInfoId").value=arrretu[3].toString();
					$d("amount").value=arrretu[4].toString();
					return true;
				}
			}
		</script>
		
<style type="text/css">
<!--
fieldset {
    padding:10px;
    margin:10px;
    width:100%;
    color:#333; 
} 
legend {
    color:#06c;
    font-weight:800; 
    background:#fff;
} 
	-->
</style>
		
	</head>


	<body onload="initVali()">
		<%@ include file="/messages.jsp"%>
		<s:form action="validate_build" namespace="/" name="pageform">		
			
			<div>
				<table width="100%" class="tb_input" border="0" cellpadding="0"
					cellspacing="1">
					<tr>
						<td width="200px" valign="top">
							<table width="100%" class="tb_input" border="0" cellpadding="0"
								cellspacing="1">
								<tr>
									<td>
										订单商品信息
									</td>
								</tr>
								<tr>
									<td align="center">
										<IMG height="180" width="180" alt="商品图片"
											src="<%=request.getContextPath()%>/upload/seal/s_${product.image1}">
									</td>
								</tr>
								<tr>
									<td>
										<table border="0" cellpadding="0" cellspacing="1">
											<tr>
												<td align="right">
													<input type="hidden" id="productId" name="orderInfo.productId" value="${orderInfo.productId}" />
													商品名称：
												</td>
												<td>
													${orderInfo.productName}
												</td>
											</tr>
											<tr>
												<td align="right">
													型号：
												</td>
												<td>
													${orderInfo.type}
												</td>
											</tr>
											<tr>
												<td align="right">
													颜色：
												</td>
												<td>
													<input type="hidden" name="orderInfo.color" value="${orderInfo.color}" />
													${orderInfo.color}
												</td>
											</tr>
											<tr>
												<td align="right">
													单价：
												</td>
												<td>
													<input type="hidden" id="hdfPrice" value="${orderInfo.price}" />
													<input type="hidden" id="hdfScore" value="${orderInfo.score}" />
													<input type="hidden" id="hdfDiscount" name="orderInfo.discount" value="${orderInfo.discount}" />
													${orderInfo.price}
													<s:if test='"RMB"==${orderInfo.currtype}'>
														元
													</s:if>
													<s:elseif test='"USD"==${orderInfo.currtype}'>
														美元
													</s:elseif>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
						<td valign="top">
							<!-- 订单审核/反审核/查看时显示 -->
							<div>
								<table width="100%" class="tb_input" border="0" cellpadding="0"
									cellspacing="1">
									<tr>
										<td colspan="2">
											收货地址
										</td>
									</tr>
									
									<tr>
										<td align="right" width="110">
											账户代码：
										</td>
										<td>
											公司名称+账户代码<input name="orderInfo.userName" type="text" maxlength="20"
												size="18" value="${orderInfo.userName }" />
										</td>
									</tr>
									
									<tr>
										<td align="right" width="110">
											收货人姓名：
										</td>
										<td>
											<input name="orderInfo.userName" type="text" maxlength="20"
												size="18" value="${orderInfo.userName }" />
										</td>
									</tr>
									<tr>
										<td align="right">
											手机：
										</td>
										<td>
											<input name="orderInfo.cellphone" type="text" maxlength="20"
												size="18" value="${orderInfo.cellphone }" />
										</td>
									</tr>
									<tr>
										<td align="right">
											电话：
										</td>
										<td>
											<input name="orderInfo.countryCode" type="text" maxlength="5"
												size="4" value="${orderInfo.countryCode }" />
											<input name="orderInfo.regionCode" type="text" maxlength="6"
												size="6" value="${orderInfo.regionCode }" />
											<input name="orderInfo.telephone" type="text" maxlength="15"
												size="16" value="${orderInfo.telephone }" />
										</td>
									</tr>
									<tr>
										<td align="right">
											邮政编码：
										</td>
										<td>
											<input name="orderInfo.postcode" type="text" maxlength="20"
												size="10" value="${orderInfo.postcode }" />
										</td>
									</tr>
									<tr>
										<td align="right">
											收货地址：
										</td>
										<td>
											<textarea name="orderInfo.address" id="address" rows="3"
												cols="50">${orderInfo.address }</textarea>
										</td>
									</tr>
								</table>
							</div>
							
							<div>
								<table width="100%" class="tb_input" border="0" cellpadding="0"
									cellspacing="1">
									<tr>
										<td colspan="2">
											订购信息
										</td>
									</tr>
									<tr>
										<td align="right" width="110">
											订购数量：
										</td>
										<td>
											<input name="orderInfo.amount" type="text" maxlength="8"
												size="10" value="${orderInfo.amount }"
												onPropertyChange="ReCaculate(this.value);" />
											(最小订购数量${product.minOrderNum}条)
											<input type="hidden" id="hdfMinOrderNum" value="${product.minOrderNum}" />
											<span id="amountError"></span>
										</td>
									</tr>
									<tr>
										<td align="right">
											订单留言：
										</td>
										<td>
											<textarea name="orderInfo.message" id="message" rows="4"
												cols="50">${orderInfo.message }</textarea>
										</td>
									</tr>
								</table>
							</div>
							<div>
								赠送积分：
								<span id="totalscore"> ${orderInfo.totalscore} </span> 点 订单金额：
								<span id="totalprice"> ${orderInfo.totalprice} </span>
								<s:if test='"RMB"==${orderInfo.currtype}'>
									元
								</s:if>
								<s:elseif test='"USD"==${orderInfo.currtype}'>
									美元
								</s:elseif>
							</div>
							
							<!-- 只在封条生成时才显示 (审核通过且未生成完成) -->
							<s:if test='"A01" != ${orderInfo.status} && "0" == ${orderInfo.isMake}}'>
							<div>
								<table width="100%" border="0" cellpadding="0" cellspacing="0"
									class="tb_datalist" >
									<tr >
										<td class="td_title" align="right">
											序列号：
										</td>
										<td  width="45%">
											<input type="text" size="15" maxlength="15"  id="seqId" name="seqId"/>
											位数
											<span class="red_star">*</span>
											<input type="text" size="3" maxlength="3"
												 id="seq_num"
												name="seq_num" class="{required:true,isnumber:true,maxlength:3,messages:{required:'序列号位数不能为空',isnumber:'序列号位数必须为数字'}}"/>
											系统设定
											<input type="radio"  checked="checked" id="seq_sys" value="seqsys" name="seq_sysg"  onclick="check(this)"/>
											
										</td>
										<td  colspan="2">
											自定义
											<input type="radio" id="seq_iscus" value="seq_iscus" name="seq_sysg" onclick="check(this)"/>
											前缀
											<input type="text" size="5" maxlength="5" id="seq_perfix" name="seq_perfix" />
										</td>
									</tr>
									<tr >
										<td class="td_title" align="right">
											密&nbsp;&nbsp;&nbsp;码：
										</td>
										<td>
											位数
											<span class="red_star">*</span>
											<input type="text" size="3" maxlength="3"
												id="pwd_num"
												name="pwd_num" class="{required:true,isnumber:true,maxlength:3,messages:{required:'密码位数不能为空',isnumber:'密码位数必须为数字'}}"/>
											系统设定
											<input type="radio" checked="checked" id="pwd_sys" value="pwdsys" name="pwd_sysg" onclick="check(this)" />
											全数字
											<input type="checkbox" id="pwd_isnum" name="pwd_isnum" onclick="check(this)"  />
										</td>
										<td>
											自定义
											<input type="radio" id="pwd_iscus" name="pwd_sysg" onclick="check(this)" />
											前缀
											<input type="text" size="5" maxlength="5" id="pwd_perfix" name="pwd_perfix" />
											验证码
											<input type="checkbox" id="pwd_isvail" name="pwd_isvail" onclick="check(this)"/>
										</td>
										
									</tr>
									<tr >
										<td class="td_title" align="right">
											数&nbsp;&nbsp;&nbsp;量：
										</td>
										<td  colspan="2">
										<span class="red_star">*</span>
											<input type="text" size="8" maxlength="8" id="amount"
												name="amount" class="{required:true,isnumber:true,maxlength:8,messages:{required:'数量不能为空',isnumber:'数量必须为数字'}}"/>
											<input type="hidden" id="buildtype" name="buildtype" value=""/>
										</td>					
									</tr>
								</table>
							</div>
							</s:if>
							
							<!-- 操作按钮 -->
							<div>
							<input type="button" class="button"  id="btnCheckSucc" value="审核通过" />
							<input type="button" class="button"  id="btnCheckFail" value="审核不通过" />
							<input type="button" class="button"  id="btnCreateSeq" value="生成封条" />
							</div>
						</td>
					</tr>
				</table>
			</div>
			
		</s:form>
	</body>
</html>
